package study.saas.order.facade.impl;


import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.stereotype.Component;
import study.saas.common.viewmodel.ApiResultV2;
import study.saas.common.viewmodel.PageModel;
import study.saas.order.entity.Commodity;

import study.saas.order.service.CommodityFacade;
import study.saas.order.service.CommodityService;
import study.saas.order.service.model.CommodityCreateDTO;
import study.saas.order.service.model.CommodityFilterDTO;
import study.saas.order.service.model.CommodityModifyDTO;

import javax.annotation.Resource;

/**
 * @author HuBoyu
 */
@Component("commodityFacade")
@Service(version = "1.0.0")
public class CommodityFacadeImpl implements CommodityFacade{
    @Resource
    private CommodityService service;
    @Override
    public ApiResultV2<Commodity> get(Integer id) {
        return service.get(id);
    }

    @Override
    public ApiResultV2<Commodity> delete(Integer id) {
        return service.delete(id);
    }

    @Override
    public ApiResultV2 modify(CommodityModifyDTO modify) {
        return service.modify(modify);
    }

    @Override
    public ApiResultV2<PageModel<Commodity>> list(CommodityFilterDTO filter) {return service.list(filter);
    }

    @Override
    public ApiResultV2<Commodity> create(CommodityCreateDTO create) {
        return service.create(create);
    }

}
